package com.my.study.designPatterns.templatePattern;

public abstract class CoffeinBeverageWithHook {

    /**
     * final修饰防止子类进行重写
     */
    final void prepareReceipe(){

        boilWater();
        brew();
        pourInCup();
        if(needCondiments()){
            addCondiments();
        }

    }


    public void boilWater(){

        System.out.println("boilWater------------");
    }


    public  void pourInCup(){

        System.out.println("pourInCup-----------");
    }

    abstract void brew();


    abstract  void addCondiments();


    public Boolean needCondiments(){
        return true;
    }
}
